﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using fcwms.Common;

public partial class admin_settings_cost_list : SessionManage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RptBind();
        }
    }

    #region 数据绑定==============================
    public void RptBind()
    {
        fcwms.BLL.dt_cost bll = new fcwms.BLL.dt_cost();
        DataSet ds = bll.GetList("");
        rptList.DataSource = ds.Tables[0].DefaultView; 
        rptList.DataBind();
    }
    #endregion

    #region 删除操作==============================
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        //ChkAdminLevel("sys_branch", ActionEnum.Delete.ToString()); //检查权限
        fcwms.BLL.dt_cost bll = new fcwms.BLL.dt_cost();
        for (int i = 0; i < rptList.Items.Count; i++)
        {
            int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
            CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
            if (cb.Checked)
            {
                bll.Delete(id);
            }
        }
        MessageBox.Jscript(this, "批量删除成功啦", "cost_list.aspx", "Success");
    }
    #endregion

}